# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rej
pkgver=0.7
pkgrel=1
pkgdesc='An API and a graphical tool for inspection and manipulation of classfiles for the Java platform.'
arch=('any')
groups=('blackarch' 'blackarch-decompiler' 'blackarch-reversing')
url='https://sourceforge.net/projects/rejava/'
license=('GPL2')
depends=('java-environment')
source=("https://downloads.sourceforge.net/project/rejava/reJ/reJ%20v0.7/rej_v0.7_bin.zip")
sha512sums=('a332d03bb87ba6ace3cb6f7da9b60d28b6fdab6de08a2c81d85d48f8e14a8730c08f803a775886bdf03acf6981bfdad8b0314547cbee120e8af312fbf1699864')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 "rej.jar" "$pkgdir/usr/share/$pkgname/rej.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/rej.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

